package com.jyu.edu.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name="user")
public class User {
	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE)
	long id;//主键
	@Column(unique=true)
	String username;//名称
	@Column
	String password;//加密后的密码
	@Column
	Integer status;//状态---0未激活-1激活
	@Column
	String headImg;//头像的url
	@Column
	String salt;//盐值，MD5加密，解密用
	@ManyToOne
	Role role;//角色
}
